<?php

include_once "header.php";

if ($_SESSION['canAdmin'] == 1)
{

?>

	<tr>
		<th>Delete Kill Mail</th>
	</tr>
	
	<?php

	if ((isset($_POST['do_delete'])) && (isset($_POST['killid'])))
	{
		include_once "../killclass.php";
		
		$killMail = new Kill($_POST['killid']);
		if ($killMail->status == 0)
		{
		?>
			<tr>
				<td>
				<p>Supplied Kill ID does not exist</p>
				</td>
			</tr>
		<?php	
		}
		else
		{
			$killMail->deleteKill();
		
			?>
			<tr>
				<td>
				<p>Killmail deleted</p>
				</td>
			</tr>
			<?php
		}
	}
	else
	{
		?>
		
		<tr>
			<td>
			<form action="deletekill.php" method="post">
			<table cellpadding="4">
			<tr>
				<td>Kill ID:</td>
				<td><input type="text" class="text-box" name="killid"></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" name="do_delete" value="Delete"></td>
			</tr>
			</table>
			</form>
			</td>
		</tr>
		<?php
	}
	}
	else
{
	?>
	<div id="content">
	<h1>Error</h1>
	<p>You do not have sufficient access to view this page</p>
	</div>
	<?php
}

include_once "footer.php";

?>